package com.lijin.study.java.thread.test;

public class Counter {
	
	private int c = 0;
	
	public void increment(Thread t) {
		System.out.println("Before Increment Thread:" + t.getId() + ", c is " + this.value());
		c ++;
		System.out.println("After Increment Thread:" + t.getId() + ", c is " + this.value());
	}
	
	public void decrement(Thread t) {
		System.out.println("Before Dncrement Thread:" + t.getId() + ", c is " + this.value());
		c --;
		System.out.println("After Dncrement Thread:" + t.getId() + ", c is " + this.value());
	}
	
	public int value() {
		return c;
	}
}
